Imports System.Data.SqlClient
Imports System.Data
Imports CAPA_Entidad
Imports CAPA_Utilitarios
Public Class SucursalDatos

    'Se crea una instancia unica para las conexiones
    Dim conex As Conexion = Conexion.getInstance()

    Sub listarSucursales(ByVal ds As DataSet, ByVal codEmp As String)
        Dim dt As New DataTable
        Dim con As SqlConnection = conex.obtenerConexion()

        Try
            con.Open()

            Dim query As String = "SELECT SUC,SUC_Descripcion FROM Sucursal WHERE CIA = '" & codEmp & "'"

            Dim adapter As SqlDataAdapter = New SqlDataAdapter(query, con)
            adapter.Fill(ds)
        Catch ex As Exception
            ds = Nothing
        Finally
            con.Close()
        End Try
    End Sub

End Class
